home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Clock / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.2 KB  |  109 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FRAME_H
  11. #define FRAME_H
  12.  
  13. // ----- Framework Includes -----
  14.  
  15. #ifndef FWFRAME_H
  16. #include "FWFrame.h"
  17. #endif
  18.  
  19. // ----- Foundation Includes -----
  20.  
  21. #ifndef FWSTRING_H
  22. #include "FWString.h"
  23. #endif
  24.  
  25. // ----- Graphic Includes -----
  26.  
  27. #ifndef FWRECT_H
  28. #include "FWRect.h"
  29. #endif
  30.  
  31. #ifndef FWMAPING_H
  32. #include "FWMaping.h"
  33. #endif
  34.  
  35. //========================================================================================
  36. // Classes used by this interface
  37. //========================================================================================
  38.  
  39. class FW_CTime;
  40. class CClockPart;
  41. class CClockContent;
  42. class FW_CGraphicContext;
  43.  
  44.  
  45. //========================================================================================
  46. // CClockFrame
  47. //========================================================================================
  48.  
  49. class CClockFrame : public FW_CFrame
  50. {
  51. public:
  52.     FW_DECLARE_AUTO(CClockFrame)
  53.  
  54. //----------------------------------------------------------------------------------------
  55. //    Constructor/Destructor
  56. //
  57. public:
  58.     CClockFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CClockPart* clockPart, CClockContent* content);
  59.     virtual ~ CClockFrame();
  60.  
  61. //----------------------------------------------------------------------------------------
  62. //    Inherited API
  63. //
  64. public:
  65.     virtual void         FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
  66.     virtual void         Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);    
  67.     
  68.     virtual ODShape*    AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
  69.     virtual ODShape*    AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
  70.  
  71.     virtual void         FrameShapeChanged(Environment* ev);    
  72.     virtual void        CreateSubViews(Environment* ev);
  73.     
  74. //----------------------------------------------------------------------------------------
  75. //    New API
  76. //
  77. public:
  78.     void                 UpdateAnalogClock(Environment* ev, FW_CGraphicContext& gc, const FW_CTime& time);
  79.     void                 UpdateDigitalClock(Environment* ev, FW_CGraphicContext& gc, const FW_CTime& time);
  80.  
  81.     void                 UpdateClock(Environment* ev, const FW_CTime& time);
  82.     void                ChangeClockType(Environment* ev, short newClockType);
  83.     
  84. private:
  85.     void                 DrawClockFace(Environment* ev, FW_CGraphicContext& gc);
  86.     void                 DrawHourHand(Environment* ev, FW_CGraphicContext& gc, FW_Fixed hour, FW_Fixed minute);
  87.     void                 DrawMinuteHand(Environment* ev, FW_CGraphicContext& gc, FW_Fixed minute);
  88.     void                 DrawSecondHand(Environment* ev, FW_CGraphicContext& gc, FW_Fixed second);
  89.  
  90.     void                ResetMapping(Environment* ev);
  91.  
  92.     FW_CRect            GetDigitalClockRect(Environment* ev);
  93.     
  94. //----------------------------------------------------------------------------------------
  95. //    Data Members
  96. //
  97. private:
  98.     CClockPart*         fClockPart;
  99.     CClockContent*        fContent;
  100.     FW_CString32         fFaceString;
  101.     FW_CMapping            fMapping;
  102.     FW_CFont            fDigitalFont;
  103.     FW_CTime            fLastTime;
  104.     CClockContent*        fClockContent;
  105.     
  106. };
  107.  
  108. #endif
  109.